// 页面路径：store/index.js
import Vue from "vue";
import Vuex from "vuex";
import persistence from 'vuex-uniapp-persistence';
import user from "@/store/user";
import address from "@/store/address";
Vue.use(Vuex); //vue的插件机制
//Vuex.Store 构造器选项
const store = new Vuex.Store({
  state: {
    safeArea: uni.getSystemInfoSync().safeArea,
    bounding: uni.getMenuButtonBoundingClientRect(),
    platform: uni.getSystemInfoSync().platform
  },
  getters: {},
  mutations:{
  },
  modules: {
    user, address
  },
  plugins:[persistence('kunkun')] //使用插件 数据持久化插件
});
export default store;